class Dog{
    public name:string;
    private _age:number;
    constructor(name:string,age:number){
        this.name = name;
        this._age = age;
    }
    speak(){
        return this._age;
    }
}

class Dog2 extends Dog{
    show(name:string,_age:number){
        // return (this.name,this._age)
    }
}

let dog = new Dog('小黑',3);
console.log(dog.speak())
console.log(dog.name)